UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'B/Zvp/YoXK4zmgUG5vx2VGAyLxmE/jXJewqf8mD6q7s=' 
WHERE 
  key_id = 'e19c8c5512801f4aabb5321278a3958a3a1576f08e89495f4d9a17e7a1414b2d' 
  AND (
    token = 'B/Zvp/YoXK4zmgUG5vx2VGAyLxmE/jXJewqf8mD6q7s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049