UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/sak2WU/NxDgvHKdnhJv2Mv0AINkpQ54bA6LRzeTmI8='
WHERE
key_id = 'bc3b7340226de7e68a66f35195260b4f7d62bf1c561759bf101540404eb06247'
AND (
token = '/sak2WU/NxDgvHKdnhJv2Mv0AINkpQ54bA6LRzeTmI8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)