UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DJFteZ7U8g439f+XZjwCqG7BCHahUKxksIDNvZEayW8='
WHERE
key_id = '971d64c72822d9664811a4b44a727140494c9fada6702fd54f8ad7568800a5d9'
AND (
token = 'DJFteZ7U8g439f+XZjwCqG7BCHahUKxksIDNvZEayW8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)