UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Sl3TOyw1IiPsQCQHZHZ3MfFLGnM7zjrNt3nGR8ZWekE='
WHERE
key_id = 'ed9a8cf19495226f3b901704257072f593414767dd06bafa4155e8a6a8f5d062'
AND (
token = 'Sl3TOyw1IiPsQCQHZHZ3MfFLGnM7zjrNt3nGR8ZWekE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)