UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3OIysf7cn/o0EVv0Magn0HdwNozPZtMCWqPr8jN4uxc=' 
WHERE 
  key_id = '6fe13f2125a3c9a7d24ac9286614e714e08d014ebe055a9589496e1b7cb4aaa7' 
  AND (
    token = '3OIysf7cn/o0EVv0Magn0HdwNozPZtMCWqPr8jN4uxc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034