UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0oRda/+qXcrt97TC3UQ32tbHKxYqSXibNVihgl95OKc='
WHERE
key_id = '0119857e7d057d400a62da25924c0ad80802cf22fac6e2a258dc5976a1ba00b0'
AND (
token = '0oRda/+qXcrt97TC3UQ32tbHKxYqSXibNVihgl95OKc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)