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

Query time 0.00033