UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5VrIAk6f1byz2Tq7guYEOPWON/3c2hAQqt335FPqO/s='
WHERE
key_id = '2021f09e5480c8862f5ee78cd759e583467588fe4b97c6776c7af2af5912837c'
AND (
token = '5VrIAk6f1byz2Tq7guYEOPWON/3c2hAQqt335FPqO/s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)