UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0lYBm/W2213Y8bnyoN3AFgjWlCGfIncFrkn3AOm0E9U='
WHERE
key_id = '9a1372d8e629f8c83dc1b2b4b9f36584145b3ab063565ecca33878360bf34ac9'
AND (
token = '0lYBm/W2213Y8bnyoN3AFgjWlCGfIncFrkn3AOm0E9U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)