UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bEF7Bz22QGHt0G+Joi0K96vfWMS/KeXc2CXWP061stg='
WHERE
key_id = 'f425a3e7bbf456ab1cc26fdac9f51c67750fe33755f6613da7c0a5ebaab8142f'
AND (
token = 'bEF7Bz22QGHt0G+Joi0K96vfWMS/KeXc2CXWP061stg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)