UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VlcAoxFrZko4HrjI+L6YV++nbJMwRI4QYtoq1KcsWe0=' 
WHERE 
  key_id = 'fef350f89d032c9c97b7e650cb629863753d70621f5d608230fc5535024cf6e4' 
  AND (
    token = 'VlcAoxFrZko4HrjI+L6YV++nbJMwRI4QYtoq1KcsWe0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00265