UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'E3lwVq3zQc6qRA5xzJBILnCSX6DoOvK/Sj3GS6TTUVQ='
WHERE
key_id = 'dd57325319574ef11f20ec81c65a4fc469db3e4a840b557ff1b6d6de362da79c'
AND (
token = 'E3lwVq3zQc6qRA5xzJBILnCSX6DoOvK/Sj3GS6TTUVQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)