UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yfcS2s/HuBb/abS0+lWEesemF2NhC+/VwN5/PXZQ4FI='
WHERE
key_id = 'b71a61dd9f4260481d5c5e56301360c979d31b6cebf33b3b94bf30eecffca929'
AND (
token = 'yfcS2s/HuBb/abS0+lWEesemF2NhC+/VwN5/PXZQ4FI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)