UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ikpgIL6Pja7LGE9EbNJegz52XwJv93LB7Qkv4z1ISK8='
WHERE
key_id = '20d079dd08b7fb67776df9f2cacf3130dcafbf2cafd195731d28a0637ef01094'
AND (
token = 'ikpgIL6Pja7LGE9EbNJegz52XwJv93LB7Qkv4z1ISK8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)