UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'onML5zkiQa74238BmdiabQuIj6ZMSx0CXpaA4KuwI40=' 
WHERE 
  key_id = '39dc3ccde8ffcbd9264a8149c9ef87117b6c464af423b57371d5a59a717e7d07' 
  AND (
    token = 'onML5zkiQa74238BmdiabQuIj6ZMSx0CXpaA4KuwI40=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026