UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6VUGwXFHsx/EJ0b7E3a00hl91UOIIGKhkDN/a6o1bYU='
WHERE
key_id = '96b56cdabf4841ec35186f5c1bb2684b217fe90be2e1e4ea32d5a69ecf929994'
AND (
token = '6VUGwXFHsx/EJ0b7E3a00hl91UOIIGKhkDN/a6o1bYU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)