UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4GqEm8T7jAVy5i1uVxH01nGC/zVpI7dGiaGmT0G9yC8=' 
WHERE 
  key_id = '9f76e8c4d23930ce9c1e5cd6c39fc84cc67b9a63f26ce6ffffa683978921f356' 
  AND (
    token = '4GqEm8T7jAVy5i1uVxH01nGC/zVpI7dGiaGmT0G9yC8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020