UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WjHxSXXbc/tg2V4DZQFO34id3A4Na7OSBtNckdJtAIs='
WHERE
key_id = 'babb1b349d9b9d3cc3eb21aaf2737844b213aa22151614b8857a034d8fcab4c8'
AND (
token = 'WjHxSXXbc/tg2V4DZQFO34id3A4Na7OSBtNckdJtAIs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)