UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EQv4btIWFDt23+GgG8rOexyvQJ+tUlOiZJH25aS2M14='
WHERE
key_id = 'e4c9902d7ff1d0e8885cd3cbc54b4595e2cdc4a11cde7348d924e4c5d35a7eb5'
AND (
token = 'EQv4btIWFDt23+GgG8rOexyvQJ+tUlOiZJH25aS2M14='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)