UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qfng2tSzhcc44sxxt3cOtwzTl8pjE/9QKSMNR10VVms=' 
WHERE 
  key_id = 'c5853c7a84a3227d3e37da2b924d93e0f38810729ab8a3dcd5107f6324ee684f' 
  AND (
    token = 'qfng2tSzhcc44sxxt3cOtwzTl8pjE/9QKSMNR10VVms=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041