UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DoRM+pKVOcUH72h+7G7DEoP9OabHfxyLfZD2KBbE7iw='
WHERE
key_id = 'bdf281c6872025ac3df8a3784ce7f05dd641ae586365e935a0f2bdfdc6b54501'
AND (
token = 'DoRM+pKVOcUH72h+7G7DEoP9OabHfxyLfZD2KBbE7iw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)