UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '94wTK7oT43F/Ymy1fnogPULNqY2s8Iw6Cv74HO9WQNQ=' 
WHERE 
  key_id = '42573debb576ef988d542317c99504dd943ed15edbbc5137713f21962bc96232' 
  AND (
    token = '94wTK7oT43F/Ymy1fnogPULNqY2s8Iw6Cv74HO9WQNQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035