UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Gd85UF/1CAlQbMDsDfgRWf8h9LdUTlfKxCs6d0tCVa0='
WHERE
key_id = 'c034cd3e0c84ca307fcc6ac6c7056a2a5902a4ba83cd8feebe7e068388804e36'
AND (
token = 'Gd85UF/1CAlQbMDsDfgRWf8h9LdUTlfKxCs6d0tCVa0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)