UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/X1XUh5l+qRNvRLlR1AMr60nRHm+oTneEOZd+ovY8u0='
WHERE
key_id = 'a7c75de79c916700fc5879c3f8fe656d2f8c38fb8894c245a2ba88674dce4fff'
AND (
token = '/X1XUh5l+qRNvRLlR1AMr60nRHm+oTneEOZd+ovY8u0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)