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