UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OvpnexCNLbVU42RPN6bO4vyq9GbqbehlHoEYgIzC0VM=' 
WHERE 
  key_id = '7acd9cf738c935e159f7be7ec8ee5f0a09bd82c114ee2b3649382a8a2ab4b3cb' 
  AND (
    token = 'OvpnexCNLbVU42RPN6bO4vyq9GbqbehlHoEYgIzC0VM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020