UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IjZQICJN++VWOZi/fCGDZajdR4nAhvQCeilt+nUmxbM='
WHERE
key_id = 'feaed8f3e2acc03248128e10564aa871dcceabcba7adf14774d82097b66d138e'
AND (
token = 'IjZQICJN++VWOZi/fCGDZajdR4nAhvQCeilt+nUmxbM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)