UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5ohcjmVNTxUVZVVLMyTC9dNw/JhNAnhJWo3XNoIOJVg=' 
WHERE 
  key_id = '4ddc503a438e0dca1ce9c8206d2415781044d072d2db3c49fe387442769528d4' 
  AND (
    token = '5ohcjmVNTxUVZVVLMyTC9dNw/JhNAnhJWo3XNoIOJVg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047