UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fEipyQRkiZu/6GYzmBgcSTdfJkJuu1m8/fvsWN1WZ7k='
WHERE
key_id = '824430a021b5c3d51ca447eb464f197783d08c0d616c8eaeddde89864dabdeea'
AND (
token = 'fEipyQRkiZu/6GYzmBgcSTdfJkJuu1m8/fvsWN1WZ7k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)