UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eRBbyO4NzEnbLckH3XP1jiLi1naep6NXuO6GpyjNR8o=' 
WHERE 
  key_id = '13d50dbf760c83affab348fa4e78e8c131aa542572e45f2ccc3ff15e7c88aa67' 
  AND (
    token = 'eRBbyO4NzEnbLckH3XP1jiLi1naep6NXuO6GpyjNR8o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045