UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BM58N2wwCc+stXlCo3cN0CG2iqP1l6TQ7E+UuQh6EsE='
WHERE
key_id = 'bd8b12c98acb26330d0f988800174152a8ad4988d0e11eb90644a7380e57d0f6'
AND (
token = 'BM58N2wwCc+stXlCo3cN0CG2iqP1l6TQ7E+UuQh6EsE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)